
		// Set up Sliders
		// **************
		$(function(){
			var toggleTime = 500,
			showCaptionInitially = true,

		    updateCaption = function(slider, init) {return;
		        if (init && showCaptionInitially) {
		            setTimeout(function() {
		                slider.$targetPage.find('.caption').animate({
		                    bottom: 0
		                }, toggleTime);
		            }, slider.options.delayBeforeAnimate + toggleTime);
		        } else if (!init) {
		            var cap = slider.$lastPage.find('.caption');
		            cap.css('bottom', -cap.innerHeight());
		        }
		    };

			$('#slider1').anythingSlider({
				theme           : 'minimalist-round',
				easing          : 'easeInQuint',
				//easing          : 'easeInElastic',
				//buildArrows		:  false,
				buildNavigation	:  false,
				stopAtEnd		:	false,
				delay			:	4000,
				
				startText		:  '自动播放',
				stopText		:  "停止播放",
				forwardText         : "下一单词",
				backText            : "上一单词",
				resizeContents      : false,

				 onSlideBegin: function(e, slider) {
				       
				        if((slider.targetPage==slider.pages && slider.currentPage==1)||(slider.targetPage==1 && slider.currentPage==slider.pages) )
					        {
					        //alert('a');
				        		slider.options.easing="easeInElastic";//easeInBack
					        }
				     
				    },
				/*
				 onInitialized: function(e, slider) {
				        slider.$items.each(function() {
				            var cap = $(this).find('.caption');
				            cap.css('bottom', -cap.innerHeight()).click(function() {
				                cap.animate({
				                    bottom: (cap.css('bottom') === "0px" ? -cap.innerHeight() : 0)
				                }, toggleTime);
				            });
				        });
				        updateCaption(slider, true);
				    },
				
				 // Callback before slide animates
				    onSlideBegin: function(e, slider) {
				        updateCaption(slider, true);
				    },
				*/
				onInitialized: function(e, slider) {
						slider.w_p=0;
						slider.w_f=1;
					},
				    // Callback after slide animates
				    onSlideComplete: function(slider) {
				    	fetchNewitem(slider);
				        //updateCaption(slider, false);
				       //
				       //alert(slider.currentPage);
				       	slider.options.easing="easeInQuint";
					       //
				       
				    }
			});
			function fetchNewitem(slider){cccc=slider;
				if((slider.pages - slider.currentPage<10)&&slider.w_f==1){
					slider.w_f=2;
					slider.w_p++;
					$.ajax({
						type: "POST",
						data: { ajax: "s" ,page: slider.w_p,id:$('#slider1').attr("data-id")},
						
						  url: $('#slider1').attr("data-url"),
						  success: function(data) {
							  if(data){
							  	$('#slider1').append(data);
							  	slider.updateSlider();
							  	slider.w_f=1;
							  }
							  else{
								  slider.w_f=0;
							}
						  },
						  error:function(){
							  slider.w_f=1;
							  }
						});
					
				}
			
				
			}
		
		});
	